﻿@model ProjectunitViewModel
@{
    ViewBag.Title = "选择施工单位弹出框";
    Layout = null;
}
<script type="text/javascript">
    $(document).ready(function () {
        $("select[name='numPerPage']").val(@ViewBag.numPerPage);
    });
    function PerChange(obj) {
        $("input[name='numPerPage']").val($(obj).val());
        dwzPageBreak({ targetType: 'dialog', numPerPage: $(obj).val() });

    }
</script>
<div class="pageContent" layouth="3">
    <form action="@Url.Action("UnitSplitPage", "ProjectSegment")" method="post" id="pagerForm" onsubmit="return dwzSearch(this, 'dialog');">
    <input type="hidden" name="uId" value="@ViewBag.uId" />
    <input type="hidden" name="unit_type" value="@ViewBag.unit_type" />
    <input type="hidden" name="uName" value="@ViewBag.uName" />
    <input type="hidden" name="uSection" value="@ViewBag.uSection" />
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <ul class="searchBar">
        <li><span>单位名称:</span>
            <input class="textInput" name="iput_deName" value="@(ViewBag.iput_deName)" type="text">
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
    </form>
    <table class="table" layouth="98" targettype="dialog" width="100%">
        <thead>
            <tr>
                <th>
                    标段
                </th>
                <th>
                    单位名称
                </th>
                <th width="80">
                    选择
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var info in Model.TheSegmentList)
            {
                <tr>
                    <td>@info.SEGMENT_CODE
                    </td>
                    <td>@info.SEGMENT_DEPARTNAME
                    </td>
                    <td>
                        @*<a class="btnSelect" href="javascript:$.bringBack({@ViewBag.uId:'@info.SEGMENT_ORGID', @ViewBag.uName:'@info.SEGMENT_DEPARTNAME', @ViewBag.uSection:'@info.SEGMENT_CODE'})" title="选择">选择</a>*@
                        <a class="btnSelect" href="javascript:MyBringBack({@ViewBag.uId:'@info.SEGMENT_ORGID', @ViewBag.uName:'@info.SEGMENT_DEPARTNAME', @ViewBag.uSection:'@info.SEGMENT_CODE'})" title="选择">
                            选择</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar" style="border-bottom:none;">
        <div class="pages">
            <span>每页</span>
            <select name="numPerPage" onchange="dialogPageBreak({ numPerPage: this.value })">
                <option value="1">1</option>
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="50">50</option>
            </select>
            <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
        </div>
        <div class="pagination" targettype="dialog" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
        </div>
    </div>
</div>
<script type="text/javascript">
    function MyBringBack(obj) {
        $.each(obj, function (key, val) {
            $("#" + key).val(val);
        });
        $.bringBack();
    }
</script>
